<template>
  <div class="app">
    <!-- 使用Game组件，且要无序列表 -->
    <Game>
      <template scope="obj">
        <ul>
          <li v-for="item in obj.games" :key="item.id">
            {{item.name}}
          </li>
        </ul>
      </template>
    </Game>

    <!-- 使用Game组件，且要有序列表 -->
    <Game>
      <template scope="{games}">
        <ol>
          <li v-for="item in games" :key="item.id">
            {{item.name}}
          </li>
        </ol>
      </template>
    </Game>

    <!-- 使用Game组件，且要一堆h4 -->
    <Game>
      <!-- <template scope="obj"> -->
      <!-- <template slot-scope="obj"> -->
      <template v-slot="obj">
        <h4 v-for="item in obj.games" :key="item.id">
          {{item.name}}
        </h4>
      </template>
    </Game>
  </div>
</template>

<script>
  import Game from './components/Game.vue'
  export default {
    name:'App',
    components:{Game}
  }
</script>

<style>
  .app {
    background-color: gray;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-evenly;
  }
</style>